Conventionally, position detection devices have been used to detect the position and amount of movement (amount of change) through the rotational movement or linear movement of a moving body, in machine tools and the like. As this kind of position detection device, a device has been known that is provided with a magnetic sensor capable of detecting change in an external magnetic field accompanying movement of the moving body, and a signal indicating the relative positional relationship between the moving body and a magnetic sensor is output from the magnetic sensor.
As the magnetic sensor used in such a position detection device, a sensor that is a laminated body having a free layer and a magnetization fixed layer and provided with a magnetoresistive element (TMR element) in which resistance varies with a change in the magnetization direction of the free layer in accordance with an external magnetic field is known.
The TMR element includes a plurality of magnetoresistive laminated bodies (TMR laminated bodies) connected in series. The TMR laminated bodies have low electrostatic discharge (ESD) tolerance, and there is a risk that the TMR laminated bodies could be destroyed if excess voltage or excess current caused by a surge in static electricity or the like flows. Consequently, a plurality of TMR laminated bodies is connected in series in the TMR element for the purposes of reducing the voltage applied to each of the TMR laminated bodies and to improve ESD tolerance.